//
//  ZLMainPageVC.m
//  Quartz2D
//
//  Created by zhaolei on 2018/4/9.
//  Copyright © 2018年 zhaolei. All rights reserved.
//

#import "ZLMainPageVC.h"
#import "ZLMainPageV.h"
#import "ZLOtherPageVC.h"

@interface ZLMainPageVC ()

@end

@implementation ZLMainPageVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"MainPage";
    [self addSubviews];
}

#pragma mark - Add
- (void)addSubviews {
    ZLMainPageV *mainPageV = [[ZLMainPageV alloc] initWithFrame:self.view.frame];
    [self.view addSubview:mainPageV];
    
    __weak typeof(self)weakSelf = self;
    
    //单元格的点击事件
    mainPageV.clickRow = ^(NSIndexPath *IndexPath) {
        ZLOtherPageVC *otherPageVC = [ZLOtherPageVC new];
        otherPageVC.IndexPath = IndexPath;
        [weakSelf.navigationController pushViewController:otherPageVC animated:YES];
    };
    
}

@end
